app.controller(ꞌprojectListControllerꞌ)   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
'use strict';
2
3
var app = angular.module('angularApp', ['ngRoute']);
4
5
var url = 'http://kevin-hwang-website.herokuapp.com';
6
var port = 3000;
7
8
app.config(['$routeProvider', '$locationProvider',
9
    function ($routeProvider, $locationProvider) {
10
11
        $locationProvider.html5Mode({
12
            enabled: true,
13
            requireBase: false
14
        });
15
16
        $routeProvider
17
18
        //load home page
19
            .when('/', {
20
                templateUrl: 'main',
21
                controller: 'mainController'
22
            })
23
24
            //load projectList page
25
            .when('/projectList', {
26
                templateUrl: 'projectList',
27
                controller: 'projectListController'
28
            })
29
30
            //load project page
31
            .when('/project:projectId', {
32
                templateUrl: 'project',
33
                controller: 'projectController'
34
            })
35
36
            .otherwise({
37
                redirectTo: '/'
38
            });
39
    }]);
40
41
42
app.controller('mainController', ['$scope', '$window', '$http', function ($scope, $window, $http) {
43
44
    $scope.resume = function () {
45
        $window.location.href = '/src/Resume.pdf';
46
    };
47
48
    $http.get(url + '/api')
49
        .success(function(data) {
50
            $scope.items = data.Projects;
51
            console.log($scope.items);
0 ignored issues
show
Debugging Code introduced by
console.log looks like debug code. Are you sure you do not want to remove it?
Loading history...
52
        });
53
}]);
54
55
app.controller('projectListController', function ($scope) {
0 ignored issues
show
Unused Code introduced by
The parameter $scope is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
56
57
});
58
59
app.controller('projectController', function ($scope) {
0 ignored issues
show
Unused Code introduced by
The parameter $scope is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
60
61
});
62
63